package com.ja.openchat.ui.contact.search;

import com.chad.library.adapter.base.entity.JSectionEntity;
import com.chad.library.adapter.base.entity.SectionEntity;

public class SearchSection extends JSectionEntity {
    //"好友", "公开联系人", "我的群组", "公开群组", "我的频道", "公开频道", "聊天记录"
    public static final int SearchSectionType_MyContacts = 1;
    public static final int SearchSectionType_PublicContacts = 2;
    public static final int SearchSectionType_MyGroups = 3;
    public static final int SearchSectionType_PublicGroups = 4;
    public static final int SearchSectionType_MyChannels = 5;
    public static final int SearchSectionType_PublicChannels = 6;
    public static final int SearchSectionType_HisMsgs = 7;

    private boolean isHeader;
    private Object obj;
    private int type;

    public SearchSection(boolean isHeader, Object obj, int type) {
        this.isHeader = isHeader;
        this.obj = obj;
        this.type = type;
    }

    public Object getObject() {
        return obj;
    }

    @Override
    public boolean isHeader() {
        return isHeader;
    }

    public int getType() {
        return type;
    }

    @Override
    public int getItemType() {
        if (isHeader()) {
            return SectionEntity.Companion.HEADER_TYPE;
        } else {
            return type;
        }
    }
}
